<?php
require_once '../utils/common.php';
require_once '../Config.php';
checkUserValidate ();
$type = $_GET ['type'];
$id = $_REQUEST ['id'];
if ($id != - 1) {
	$con = mysql_connect ( host, username, password );
	if (! $con) {
		die ( 'Could not connect: ' . mysql_error () );
	}
	mysql_select_db ( db, $con );
	$sql = "set names utf8";
	mysql_query ( $sql );
	$sql = "select * from j_tab_model where id=" . $id;
	$result = mysql_query ( $sql );
	if ($row = mysql_fetch_array ( $result )) {
		$icon = ip . project . $row ['icon'] ;
		$name = $row ['name'];
		$link = $row ['link'];
		$type = $row ['type'];
		$isPhone = $row ['isPhone'];
	}
	mysql_close ( $con );
}


?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>管理系统</title>
<link href="../CSS/form.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="../ckeditor/ckeditor.js"></script>
<script type="text/javascript" src="../js/jquery-1.10.1.js"></script>
<script type="text/javascript">

</script>
</head>

<body>
	<fieldset>
		<legend>修改</legend>
		<form action="ModelProcess.php" method="post" class="form"
			enctype="multipart/form-data">
			<input type="hidden" name="flag" value="update" />
			<input type="hidden" name="id" value="<?=$id?>" /> <input
				type="hidden" name="type" value="<?=$type?>" />
			<ul>
				<li><label>图标:</label></li>
				<li><input type="file" name="icon" id="icon" class="txt" value="<?=$icon?>" /></li>
				<li><img style="width: 20px;height: 20px" src="<?=$icon?>"></img></li>
				<li><label>名字:</label></li>
				<li><input type="text" name="name" id="name" class="txt"
					value=<?=$name?> /></li>
				<li><label>链接:</label></li>
				<li><label>填写链接后客户端点击直接跳转浏览器</label></li>
				<li><input type="text" name="link" id="link" class="txt" value="<?=$link?>"/></li>
				<li><label>是否是电话模块:</label></li>
				<li><input type="radio" name="isPhone" value="1" <?php if($isPhone==1) echo("checked");?>>是电话模块
					<li>
						<li><input type="radio" name="isPhone" value="0" <?php if($isPhone==0) echo("checked");?>>不是电话模块
							<li>
								<li><input type="submit" value="修改" class="btn" /></li>
			
			</ul>
		</form>
	</fieldset>
</body>

</html>